<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>按键触发操作</title>
	</head>
	<body>
		
		 <div id="app">
			<h3>用户数据：{{num}}</h3>
			<input type="text" v-model="num2" v-on:keyup.enter="addNum"> 
			<button type="button" @click="addNum">计算</button>
		 </div>
		 <!-- 1.导入js文件-->
		 <script src="../js/vue.js"> </script>
		 <!-- 3.创建vue对象-->
		 <script>
			 
			const APP =new Vue({
				//1.注定区域
				el: "#app",
				data: {
					num:100,
					num2:0
				},
				methods:{
					addNum(){
						this.num+=parseInt(this.num2)
					}
				}
				
			})
		 </script>
	</body>
</html>
